package com.nine.demo.properties;


import com.nine.demo.enums.SmsTypeEnum;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * 绑定 application.properties 中的 sms 配置
 */
@Data
@ConfigurationProperties(prefix = "sms")
public class SmsProperties {

    /**
     * 短信服务类型，通过枚举类 SmsTypeEnum 来指定，默认是阿里云
     */
    private String type;

    private String accessKeyId;
    private String accessKeySecret;
    private String signName;

    public String getType() {
        if (type == null || "".equals(type)) {
            type = SmsTypeEnum.ALI_CLOUD.getType();
        }
        return type;
    }
}
